/***TABLE II: ROBUSTNESS*****/

global fixed_effects "cb pop_dec#elec_id CBG#elec_id"

foreach y in reg vote {

	use ../data/main.dta, clear
	keep if sample_main
	
	// main specification
	sum `y' if tau==-1 
	local m = round(r(mean), .01)
    reghdfe `y' treat_post , absorb( $fixed_effects )  cluster(CBG) nocons
	outreg2 using ../output/table2_robust.xls, append stats(coef se) ctitle(`y') dec(3) ///
		alpha(.01, .05, .10) addtext(model, main, mean, `m') symbol(***, **, *) excel
	
	// control for homicides
	sum `y' if tau==-1
	local m = round(r(mean), .01)
	reghdfe `y' treat_post num_homicide,  absorb( $fixed_effects )  cluster(CBG) nocons
	outreg2 using ../output/table2_robust.xls, append stats(coef se) ctitle(`y') dec(3) ///
		alpha(.01, .05, .10) addtext(model, num_homicide, mean, `m') symbol(***, **, *) excel

	// control for black/hispanic quintile
	sum `y' if tau==-1
	local m = round(r(mean), .01)
	reghdfe `y' treat_post,  absorb( $fixed_effects  blhi_qu_c00#elec_id )  cluster(CBG) nocons
	outreg2 using ../output/table2_robust.xls, append stats(coef se) ctitle(`y') dec(3) ///
		alpha(.01, .05, .10) addtext(model, blhi_qu x elec_id, mean, `m') symbol(***, **, *) excel
		
	// control for 10-17 in 2000 quintile
	sum `y' if tau==-1
	local m = round(r(mean), .01)
	reghdfe `y' treat_post,  absorb( $fixed_effects  age_10_17_qu#elec_id )  cluster(CBG) nocons
	outreg2 using ../output/table2_robust.xls, append stats(coef se) ctitle(`y') dec(3) ///
		alpha(.01, .05, .10) addtext(model, ages_10_17_qu x elec_id, mean, `m') symbol(***, **, *) excel
	
	// control for 2000-2010 pop change
	sum `y' if tau==-1
	local m = round(r(mean), .01)
	reghdfe `y' treat_post,  absorb( $fixed_effects  c.pop_change#elec_id )  cluster(CBG) nocons
	outreg2 using ../output/table2_robust.xls, append stats(coef se) ctitle(`y') dec(3) ///
		alpha(.01, .05, .10) addtext(model, pop_change x elec_id, mean, `m') symbol(***, **, *) excel

	// drop population controls
	sum `y' if tau==-1
	local m = round(r(mean), .01)
	reghdfe `y' treat_post,  absorb(cb CBG#elec_id)  cluster(CBG) nocons
	outreg2 using ../output/table2_robust.xls, append stats(coef se) ctitle(`y') dec(3) ///
		alpha(.01, .05, .10) addtext(model, no pop ctrls, mean, `m') symbol(***, **, *) excel
		
	
	// drop multi-treat blocks
	use ../data/main.dta, clear
	keep if sample_main & multi_treat==0
	
	sum `y' if tau==-1
	local m = round(r(mean), .01)
	reghdfe `y' treat_post, absorb( $fixed_effects )  cluster(CBG) nocons
	outreg2 using ../output/table2_robust.xls, append stats(coef se) ctitle(`y') dec(3) ///
		alpha(.01, .05, .10) addtext(model, multishoot, mean, `m') symbol(***, **, *) excel

	// unrestricted sample
	use ../data/main.dta, clear

	sum `y' if tau==-1
	local m = round(r(mean), .01)
	reghdfe `y' treat_post, absorb(cb pop_dec_unrestricted#elec_id CBG#elec_id)  cluster(CBG) nocons
	outreg2 using ../output/table2_robust.xls, append stats(coef se) ctitle(`y') dec(3) ///
		alpha(.01, .05, .10) addtext(model, unrestrict, mean, `m') symbol(***, **, *) excel
		
	// restrict to CBs with 10+ registered voters in 2002
	use ../data/main.dta, clear
	keep if sample_main & reg_02>=10

	sum `y' if tau==-1
	local m = round(r(mean), .01)
	reghdfe `y' treat_post, absorb( $fixed_effects )  cluster(CBG) nocons
	outreg2 using ../output/table2_robust.xls, append stats(coef se) ctitle(`y') dec(3) ///
		alpha(.01, .05, .10) addtext(model, reg02_10pl, mean, `m') symbol(***, **, *) excel
}
